<template>
  <div class="detail_mian">
    <div class="title">{{data.title}}</div>
    <div class="source">{{data.publishTime}}     来源：{{data.source}}</div>
    <div class="detail_content" v-html="data.content"></div>
  </div>
</template>
<script>
  export default {
    name: 'index',
    data () {
      return {
        id:this.$route.query.postId,
        source:this.$route.query.source,
        data:[]
      }
    },
    methods: {
        loadData(){
          this.$http.get("/site/post/detail", {
              params: {postId: this.id,appId:process.env.ClientId,source:this.source}
          }).then(res => {
              console.log(res)
            this.data=res.body;
            this.data.publishTime=this.util.parseTime(this.data.publishTime);
          })
        }
    },
    created(){
        this.loadData();
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  /*.detail_mian{position: fixed;min-height: 100%;width: 100%;top:0px;left: 0px;background: #ffffff;}*/
  .title{font-size: 17px;color: #000000;line-height: 21px;font-weight: bold;margin: 15px 4%;}
  .source{font-size: 13px;color: #888888;margin-left: 4%;}
  .detail_content{font-size: 16px; color: #333333; line-height: 30px;margin:10px 4%;}
</style>
